package com.tencent.ied.bk.handler.impl;

import com.tencent.ied.bk.common.LocalStore;
import com.tencent.ied.bk.entity.SearchAbstractInfo;
import com.tencent.ied.bk.handler.Handler;
import com.tencent.ied.bk.handler.HandlerObject;

import java.util.List;

/**
 * @author chen_yu
 * @date 2021/3/11 6:26
 */
public class SearchKeyWordHandler implements Handler {
    @Override
    public void handle(HandlerObject handlerObject) {
        List<SearchAbstractInfo> searchAbstractInfoList = handlerObject.getSearchAbstractInfoList();
        for (SearchAbstractInfo searchAbstractInfo : searchAbstractInfoList) {
            int count = LocalStore.WORD_INDEX.get(handlerObject.getStrKeyWord())[searchAbstractInfo.getId()];
            searchAbstractInfo.setSearchKeyWordCountInContent(count);
        }
    }
}
